<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      ul {
        margin: 0;
        padding: 0;
        margin: 0 auto;
        display: flex;
        flex-wrap: wrap;
        list-style: none;
        /* vertical gap 5px, horizontal gap 10px */
        gap: 5px 10px;
      }

      li {
        margin: 0;
        padding: 0;
        width: 200px;
        height: 200px;
        line-height: 200px;
        text-align: center;
        background-color: black;
        color: antiquewhite;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>8</li>
      </ul>
    </div>
  </body>
</html>
